package com.sixth.volunteerservicesystem.Controller.ExamController.backExam;

import com.sixth.volunteerservicesystem.Dao.QuestionRepository;
import com.sixth.volunteerservicesystem.domain.Subjects;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Steve Jobs
 * @create 2021-01-10 13:18
 */
@Controller
public class Examlist {

    @Autowired
    QuestionRepository questionRepository;

    @RequestMapping("/backExamList")
    public String  examList(Model model){

        List<Subjects> list = new ArrayList<>();

        list = questionRepository.findAll();

        model.addAttribute("subjects",list);


        return "backstageExam/backExam";
    }
}
